<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>
</head>

<body>
    <div id="box"></div>
    <div id="box1"></div>
    <script type="text/javascript" src="./js/react.development.js"></script>
    <!-- 提供了操作DOM的react扩展库 -->
    <script type="text/javascript" src="./js/react-dom.development.js"></script>
    <!-- 解析jsx语法的代码转换为js语法 -->
    <script type="text/javascript" src="./js/babel.min.js"></script>
    <script src="./js/prop-types.js"></script>
    <script type="text/babel">

        class Component1 extends React.Component {
        constructor(props) {
          super(props);
        //   this.testEvent = this.testEvent.bind(this);
        }
        testEvent(a,b,e){
            console.log('第一个事件！！');
            console.log(this);
            // 点击之后执行
            console.log(a);
            console.log(b);
            console.log(e);
        }
        render() {
          return (
            <div>
                <h1>事件</h1>
                {/*this.testEvent()回调函数自己执行  */}
                <button onClick={this.testEvent.bind(this,1,2)}>test 普通的绑定</button>
            </div>
          );
        }
      }
    
      ReactDOM.render(<Component1/>, document.getElementById("box"));
    </script>
</body>

</html>